My Profile_


Open Totals

NEW!   We now have our Interactive tool for this section.

Returns the details about the currently open batch.

This transaction is similar to the Batch Close. The difference is that it does not close the batch for settlement.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaOpenTotals
{
	public static void main(String[] args)
	{
		String store_id = "store5";
		String api_token = "yesguy";
		String ecr_no = "66013455";
		//String ecr_no = "66011091";
		String processing_country_code = "CA";

		OpenTotals opentotals = new OpenTotals();
		opentotals.setEcrno(ecr_no);

		HttpsPostRequest mpgReq = new HttpsPostRequest();
		mpgReq.setProcCountryCode(processing_country_code);
		mpgReq.setTestMode(true); //false or comment out this line for production transactions
		mpgReq.setStoreId(store_id);
		mpgReq.setApiToken(api_token);
		mpgReq.setTransaction(opentotals);
		mpgReq.send();
		
		try
		{
			Receipt receipt = mpgReq.getReceipt();

			if ((receipt.getReceiptId()).equals("Global Error Receipt") || 
					 receipt.getReceiptId().equals("null") || 
					 receipt.getReceiptId().equals(""))
			{
				System.out.println("CardType = null");
				System.out.println("TransAmount = " + receipt.getTransAmount());
				System.out.println("TxnNumber = " + receipt.getTxnNumber());
				System.out.println("ReceiptId = " + receipt.getReceiptId());
				System.out.println("TransType = " + receipt.getTransType());
				System.out.println("ReferenceNum = " + receipt.getReferenceNum());
				System.out.println("ResponseCode = " + receipt.getResponseCode());
				System.out.println("ISO = " + receipt.getISO());
				System.out.println("BankTotals = null");
				System.out.println("Message = " + receipt.getMessage());
				System.out.println("AuthCode = " + receipt.getAuthCode());
				System.out.println("Complete = " + receipt.getComplete());
				System.out.println("TransDate = " + receipt.getTransDate());
				System.out.println("TransTime = " + receipt.getTransTime());
				System.out.println("Ticket = " + receipt.getTicket());
				System.out.println("TimedOut = " + receipt.getTimedOut());
			}
			else
			{
				for (String ecr : receipt.getTerminalIDs())
				{
					System.out.println("ECR: " + ecr);
					
					for (String cardType : receipt.getCreditCards(ecr))
					{
						System.out.println("\tCard Type: " + cardType);

						System.out.println("\t\tPurchase: Count = "
								+ receipt.getPurchaseCount(ecr, cardType)
								+ " Amount = "
								+ receipt.getPurchaseAmount(ecr,
									cardType));

						System.out.println("\t\tRefund: Count = "
								+ receipt.getRefundCount(ecr, cardType)
								+ " Amount = "
								+ receipt.getRefundAmount(ecr, cardType));

						System.out.println("\t\tCorrection: Count = "
								+ receipt.getCorrectionCount(ecr, cardType)
								+ " Amount = "
								+ receipt.getCorrectionAmount(ecr,
									cardType));
					}
				}
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

OpenTotals transaction object definition

OpenTotals opentotals = new OpenTotals();

HttpsPostRequest object for Open Totals transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(opentotals);

Open Totals transaction object mandatory values

Value Type Limits Set method Description
ECR (electronic cash register) number String No limit (value provided by Moneris) opentotals.setEcrno(ecr_no); Electronic cash register number.

Open Totals transaction object optional values

None.

Open Totals Response Fields

Value Limits Variable Description
Processed Card Type String Array receipt.getCreditCards(ecr_no); Returns all of the processed card types in the current batch for the terminal ID/ECR Number from the request.
Terminals IDs 8 – character alphanumeric receipt.getTerminalIDs(); Returns the terminal ID/ECR Number from the request.
Purchase Count 4 – character numeric receipt.getPurchaseCount(ecr,cardType); Indicates the # of Purchase, ACH debit, Pre-Authorization Completion and Force Post transactions processed. If none were processed in the batch, then 0000 will be returned.
Purchase Amount 11 – character alphanumeric receipt.getPurchaseAmount(ecr,cardType); Indicates the dollar amount processed for Purchase, ACH debit, Pre-Authorization Completion or Force Post transactions. This field begins with a + and is followed by 10 numbers, the first 8 indicate the amount and the last 2 indicate the penny value.
Example, +0000000000 = 0.00 and +0000041625 = 416.25
Refund Count 4 – character numeric receipt.getRefundCount(ecr,cardType); Indicates the # of Refund, Independent Refund or ACH Credit transactions processed. If none were processed in the batch, then 0000 will be returned.
Refund Amount 11 – character alphanumeric receipt.getRefundAmount(ecr,cardType); Indicates the dollar amount processed for Refund, Independent Refund or ACH Credit transactions. This field begins with a + and is followed by 10 numbers, the first 8 indicate the amount and the last 2 indicate the penny value.
Example, +0000000000 = 0.00 and +0000041625 = 416.25
Correction Count 4 – character numeric receipt.getCorrectionCount(ecr,cardType); Indicates the # of Purchase Correction or ACH Reversal transactions processed. If none were processed in the batch, then 0000 will be returned.
Correction Amount 11 – character alphanumeric receipt.getCorrectionAmount(ecr,cardType); Indicates the dollar amount processed for Purchase Correction or ACH Reversal transactions. This field begins with a + and is followed by 10 numbers, the first 8 indicate the amount and the last 2 indicate the penny value.
Example, +0000000000 = 0.00 and +0000041625 = 416.25